const _ = require('lodash');
// function reverse(arr){
//     return arr.reverse();
// }
// function first(arr){
//     return arr[0]
// }
// function toUpperCase(str){
//     return str.toUpperCase()
// }
const reverse = arr=>arr.reverse();
const first = arr =>arr[0];
const toupper = str =>str.toUpperCase()
const compose = (...args)=>(val)=>args.reverse().reduce((Cumulative,fn)=>fn(Cumulative),val)
const fn = compose(toupper,first,reverse)
console.log(fn(['one','two','three']))
// function compose(...args){
//     return function(val){
//         return args.reverse().reduce((Cumulative,fn)=>{
//             return fn(Cumulative)
//         },val)
//     }
// }
